﻿//Created by Action Script Viewer - http://www.buraks.com/asv
package Init {
    import flash.events.*;
    import Engine.Init.*;
    import flash.utils.*;
    import Classes.*;
    import plugin.*;

    public class ServiceInit extends InitializationAction {

        public static const INIT_ID:String = "ServiceInit";

        public function ServiceInit(){
            super(INIT_ID);
            addDependency(BootstrapInit.INIT_ID);
        }
        override public function execute():void{
            var _local4:XML;
            var _local5:XML;
            var _local1:XML = Global.bootstrap.setting;
            var _local2 = "../util/boots.swf";
            if ((((Global.isSandbox == false)) && ((_local1.bootstrap.length() > 0)))){
                _local4 = _local1.bootstrap[0];
                if (_local4.plugins.length() > 0){
                    for each (_local5 in _local4.plugins.plugin) {
                        if (_local5.attribute("type").toString() == "boots"){
                            _local2 = _local5.attribute("locator").toString();
                            break;
                        };
                    };
                };
            };
            var _local3:PluginLoader = new PluginLoader(_local2);
            _local3.load(this.onBootsLoaded);
        }
        private function onBootsLoaded(_arg1:Event):void{
            var _local2:Object;
            var _local3:Dictionary;
            var _local4:Function;
            if (((_arg1) && (_arg1.target.content))){
                _local2 = _arg1.target.content;
                if (!_local2.hasOwnProperty("binding")){
                    return;
                };
                _local3 = (_local2["binding"] as Dictionary);
                _local4 = (_local3["install"] as Function);
                if (_local4 != null){
                    _local4();
                    dispatchEvent(new Event(Event.COMPLETE));
                };
            };
        }

    }
}//package Init 
